package com.mit.service.purchase.dao;

import java.util.List;

import com.mit.common.exception.NoRecordUpdateException;
import com.mit.common.purchase.dto.SupplierDTO;

public interface ISupplierDAO {

	SupplierDTO createSupplierDTO(SupplierDTO to);
	SupplierDTO updateSupplierDTO(SupplierDTO to) throws NoRecordUpdateException;
	List<SupplierDTO> retrievePagedSuppliers(Integer orgId, String searchKey, Integer pageNo, Integer pageSize);
	Integer retrieveSuppliersCount(Integer orgId, String searchKey);
	List<SupplierDTO> retrieveSupplierBasicInfo(Integer orgId, String searchKey);
	/**
	 * 验证同名供应商是否已经存在。
	 * @param id 如果提供ID，则要在此ID之外寻找同名供应商
	 * @param name 名字要完全匹配
	 * @return true=有重名
	 */
	boolean hasSupplier(Integer orgId, Integer id, String name);
}
